package interview;

public class interview_08_05 {
    public int multiply(int A, int B) {
        if(B==1) return A;
        if(B==2) return A<<1;
        if(B%2==1){
            return (multiply(A,B>>1)<<1)+A;
        }
        else return multiply(A,B>>1)<<1;
    }
}
